Optimal. Leaf size=117 \[ -\sqrt {\frac {1}{2} \left (2+\sqrt {5}\right )} \tan ^{-1}\left (\frac {5+2 \sqrt {5}-\sqrt {5} x}{\sqrt {10 \left (2+\sqrt {5}\right )} \sqrt {-1+x+x^2}}\right )+\sqrt {\frac {1}{2} \left (-2+\sqrt {5}\right )} \tanh ^{-1}\left (\frac {5-2 \sqrt {5}+\sqrt {5} x}{\sqrt {10 \left (-2+\sqrt {5}\right )} \sqrt {-1+x+x^2}}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 117, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {1050, 1044,
213, 209} \begin {gather*} \sqrt {\frac {1}{2} \left (\sqrt {5}-2\right )} \tanh ^{-1}\left (\frac {\sqrt {5} x-2 \sqrt {5}+5}{\sqrt {10 \left (\sqrt {5}-2\right )} \sqrt {x^2+x-1}}\right )-\sqrt {\frac {1}{2} \left (2+\sqrt {5}\right )} \text {ArcTan}\left (\frac {-\sqrt {5} x+2 \sqrt {5}+5}{\sqrt {10 \left (2+\sqrt {5}\right )} \sqrt {x^2+x-1}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 213
Rule 1044
Rule 1050
Rubi steps
\begin {align*} \int \frac {1+2 x}{\left (1+x^2\right ) \sqrt {-1+x+x^2}} \, dx &=-\frac {\int \frac {-\sqrt {5}+\left (-5-2 \sqrt {5}\right ) x}{\left (1+x^2\right ) \sqrt {-1+x+x^2}} \, dx}{2 \sqrt {5}}+\frac {\int \frac {\sqrt {5}+\left (-5+2 \sqrt {5}\right ) x}{\left (1+x^2\right ) \sqrt {-1+x+x^2}} \, dx}{2 \sqrt {5}}\\ &=-\left (\left (-5+2 \sqrt {5}\right ) \text {Subst}\left (\int \frac {1}{10 \left (2-\sqrt {5}\right )+x^2} \, dx,x,\frac {-5+2 \sqrt {5}-\sqrt {5} x}{\sqrt {-1+x+x^2}}\right )\right )+\left (5+2 \sqrt {5}\right ) \text {Subst}\left (\int \frac {1}{10 \left (2+\sqrt {5}\right )+x^2} \, dx,x,\frac {-5-2 \sqrt {5}+\sqrt {5} x}{\sqrt {-1+x+x^2}}\right )\\ &=-\sqrt {\frac {1}{2} \left (2+\sqrt {5}\right )} \tan ^{-1}\left (\frac {5+2 \sqrt {5}-\sqrt {5} x}{\sqrt {10 \left (2+\sqrt {5}\right )} \sqrt {-1+x+x^2}}\right )+\sqrt {\frac {1}{2} \left (-2+\sqrt {5}\right )} \tanh ^{-1}\left (\frac {5-2 \sqrt {5}+\sqrt {5} x}{\sqrt {10 \left (-2+\sqrt {5}\right )} \sqrt {-1+x+x^2}}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains higher order function than in optimal. Order 9 vs. order 3 in
optimal.
time = 0.12, size = 106, normalized size = 0.91 \begin {gather*} \frac {1}{2} \text {RootSum}\left [2-4 \text {$\#$1}+6 \text {$\#$1}^2+\text {$\#$1}^4\&,\frac {3 \log \left (-x+\sqrt {-1+x+x^2}-\text {$\#$1}\right )-2 \log \left (-x+\sqrt {-1+x+x^2}-\text {$\#$1}\right ) \text {$\#$1}+2 \log \left (-x+\sqrt {-1+x+x^2}-\text {$\#$1}\right ) \text {$\#$1}^2}{-1+3 \text {$\#$1}+\text {$\#$1}^3}\&\right ] \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(636\) vs.
\(2(86)=172\).
time = 0.55, size = 637, normalized size = 5.44
method | result | size |
trager | \(-\RootOf \left (\RootOf \left (16 \textit {\_Z}^{4}+16 \textit {\_Z}^{2}+5\right )^{2}+\textit {\_Z}^{2}+1\right ) \ln \left (\frac {4 \RootOf \left (\RootOf \left (16 \textit {\_Z}^{4}+16 \textit {\_Z}^{2}+5\right )^{2}+\textit {\_Z}^{2}+1\right ) \RootOf \left (16 \textit {\_Z}^{4}+16 \textit {\_Z}^{2}+5\right )^{2} x +2 \RootOf \left (\RootOf \left (16 \textit {\_Z}^{4}+16 \textit {\_Z}^{2}+5\right )^{2}+\textit {\_Z}^{2}+1\right ) x -\sqrt {x^{2}+x -1}+\RootOf \left (\RootOf \left (16 \textit {\_Z}^{4}+16 \textit {\_Z}^{2}+5\right )^{2}+\textit {\_Z}^{2}+1\right )}{4 x \RootOf \left (16 \textit {\_Z}^{4}+16 \textit {\_Z}^{2}+5\right )^{2}+2 x -1}\right )+\RootOf \left (16 \textit {\_Z}^{4}+16 \textit {\_Z}^{2}+5\right ) \ln \left (\frac {4 \RootOf \left (16 \textit {\_Z}^{4}+16 \textit {\_Z}^{2}+5\right )^{3} x +2 \RootOf \left (16 \textit {\_Z}^{4}+16 \textit {\_Z}^{2}+5\right ) x -\RootOf \left (16 \textit {\_Z}^{4}+16 \textit {\_Z}^{2}+5\right )-\sqrt {x^{2}+x -1}}{4 x \RootOf \left (16 \textit {\_Z}^{4}+16 \textit {\_Z}^{2}+5\right )^{2}+2 x +1}\right )\) | \(248\) |
default | \(\frac {\sqrt {\frac {10 \left (-\sqrt {5}-2+x \right )^{2}}{\left (-\sqrt {5}+2-x \right )^{2}}-\frac {5 \sqrt {5}\, \left (-\sqrt {5}-2+x \right )^{2}}{\left (-\sqrt {5}+2-x \right )^{2}}+10+5 \sqrt {5}}\, \sqrt {5}\, \left (\arctan \left (\frac {\sqrt {5}\, \sqrt {\left (-2+\sqrt {5}\right ) \left (-\frac {\left (-\sqrt {5}-2+x \right )^{2}}{\left (-\sqrt {5}+2-x \right )^{2}}+4 \sqrt {5}+9\right )}\, \sqrt {20+10 \sqrt {5}}\, \left (\frac {\sqrt {5}\, \left (-\sqrt {5}-2+x \right )^{2}}{\left (-\sqrt {5}+2-x \right )^{2}}+\frac {2 \left (-\sqrt {5}-2+x \right )^{2}}{\left (-\sqrt {5}+2-x \right )^{2}}-\sqrt {5}+2\right ) \left (-\sqrt {5}-2+x \right ) \left (-2+\sqrt {5}\right )}{5 \left (-\sqrt {5}+2-x \right ) \left (\frac {\left (-\sqrt {5}-2+x \right )^{4}}{\left (-\sqrt {5}+2-x \right )^{4}}-\frac {18 \left (-\sqrt {5}-2+x \right )^{2}}{\left (-\sqrt {5}+2-x \right )^{2}}+1\right )}\right ) \sqrt {5}+\arctanh \left (\frac {\sqrt {\frac {10 \left (-\sqrt {5}-2+x \right )^{2}}{\left (-\sqrt {5}+2-x \right )^{2}}-\frac {5 \sqrt {5}\, \left (-\sqrt {5}-2+x \right )^{2}}{\left (-\sqrt {5}+2-x \right )^{2}}+10+5 \sqrt {5}}}{\sqrt {20+10 \sqrt {5}}}\right )+2 \arctan \left (\frac {\sqrt {5}\, \sqrt {\left (-2+\sqrt {5}\right ) \left (-\frac {\left (-\sqrt {5}-2+x \right )^{2}}{\left (-\sqrt {5}+2-x \right )^{2}}+4 \sqrt {5}+9\right )}\, \sqrt {20+10 \sqrt {5}}\, \left (\frac {\sqrt {5}\, \left (-\sqrt {5}-2+x \right )^{2}}{\left (-\sqrt {5}+2-x \right )^{2}}+\frac {2 \left (-\sqrt {5}-2+x \right )^{2}}{\left (-\sqrt {5}+2-x \right )^{2}}-\sqrt {5}+2\right ) \left (-\sqrt {5}-2+x \right ) \left (-2+\sqrt {5}\right )}{5 \left (-\sqrt {5}+2-x \right ) \left (\frac {\left (-\sqrt {5}-2+x \right )^{4}}{\left (-\sqrt {5}+2-x \right )^{4}}-\frac {18 \left (-\sqrt {5}-2+x \right )^{2}}{\left (-\sqrt {5}+2-x \right )^{2}}+1\right )}\right )\right )}{\sqrt {-\frac {5 \left (\frac {\sqrt {5}\, \left (-\sqrt {5}-2+x \right )^{2}}{\left (-\sqrt {5}+2-x \right )^{2}}-\frac {2 \left (-\sqrt {5}-2+x \right )^{2}}{\left (-\sqrt {5}+2-x \right )^{2}}-\sqrt {5}-2\right )}{\left (1+\frac {-\sqrt {5}-2+x}{-\sqrt {5}+2-x}\right )^{2}}}\, \left (1+\frac {-\sqrt {5}-2+x}{-\sqrt {5}+2-x}\right ) \sqrt {20+10 \sqrt {5}}}\) | \(637\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 758 vs.
\(2 (86) = 172\).
time = 0.37, size = 758, normalized size = 6.48 \begin {gather*} \frac {1}{20} \cdot 5^{\frac {1}{4}} \sqrt {4 \, \sqrt {5} + 10} {\left (2 \, \sqrt {5} - 5\right )} \log \left (2 \, x^{2} - 2 \, \sqrt {x^{2} + x - 1} x + \frac {1}{5} \, {\left (5^{\frac {1}{4}} \sqrt {x^{2} + x - 1} {\left (2 \, \sqrt {5} - 5\right )} - 5^{\frac {1}{4}} {\left (\sqrt {5} {\left (2 \, x + 1\right )} - 5 \, x\right )}\right )} \sqrt {4 \, \sqrt {5} + 10} + x + \sqrt {5}\right ) - \frac {1}{20} \cdot 5^{\frac {1}{4}} \sqrt {4 \, \sqrt {5} + 10} {\left (2 \, \sqrt {5} - 5\right )} \log \left (2 \, x^{2} - 2 \, \sqrt {x^{2} + x - 1} x - \frac {1}{5} \, {\left (5^{\frac {1}{4}} \sqrt {x^{2} + x - 1} {\left (2 \, \sqrt {5} - 5\right )} - 5^{\frac {1}{4}} {\left (\sqrt {5} {\left (2 \, x + 1\right )} - 5 \, x\right )}\right )} \sqrt {4 \, \sqrt {5} + 10} + x + \sqrt {5}\right ) - \frac {1}{5} \cdot 5^{\frac {3}{4}} \sqrt {4 \, \sqrt {5} + 10} \arctan \left (\frac {2}{55} \, \sqrt {5} {\left (\sqrt {5} {\left (2 \, x - 1\right )} + 3 \, x + 4\right )} + \frac {1}{275} \, \sqrt {10 \, x^{2} - 10 \, \sqrt {x^{2} + x - 1} x + {\left (5^{\frac {1}{4}} \sqrt {x^{2} + x - 1} {\left (2 \, \sqrt {5} - 5\right )} - 5^{\frac {1}{4}} {\left (\sqrt {5} {\left (2 \, x + 1\right )} - 5 \, x\right )}\right )} \sqrt {4 \, \sqrt {5} + 10} + 5 \, x + 5 \, \sqrt {5}} {\left ({\left (5^{\frac {3}{4}} {\left (2 \, \sqrt {5} + 3\right )} + 2 \cdot 5^{\frac {1}{4}} {\left (4 \, \sqrt {5} - 5\right )}\right )} \sqrt {4 \, \sqrt {5} + 10} + 2 \, \sqrt {5} {\left (3 \, \sqrt {5} + 10\right )} - 20 \, \sqrt {5} + 80\right )} - \frac {2}{55} \, \sqrt {x^{2} + x - 1} {\left (\sqrt {5} {\left (2 \, \sqrt {5} + 3\right )} + 8 \, \sqrt {5} - 10\right )} + \frac {1}{55} \, \sqrt {5} {\left (16 \, x + 3\right )} + \frac {1}{275} \, {\left (5^{\frac {3}{4}} {\left (\sqrt {5} {\left (3 \, x + 4\right )} + 10 \, x - 5\right )} - \sqrt {x^{2} + x - 1} {\left (5^{\frac {3}{4}} {\left (3 \, \sqrt {5} + 10\right )} - 10 \cdot 5^{\frac {1}{4}} {\left (\sqrt {5} - 4\right )}\right )} - 10 \cdot 5^{\frac {1}{4}} {\left (\sqrt {5} {\left (x - 6\right )} - 4 \, x + 13\right )}\right )} \sqrt {4 \, \sqrt {5} + 10} - \frac {4}{11} \, x + \frac {2}{11}\right ) - \frac {1}{5} \cdot 5^{\frac {3}{4}} \sqrt {4 \, \sqrt {5} + 10} \arctan \left (-\frac {2}{55} \, \sqrt {5} {\left (\sqrt {5} {\left (2 \, x - 1\right )} + 3 \, x + 4\right )} + \frac {1}{275} \, \sqrt {10 \, x^{2} - 10 \, \sqrt {x^{2} + x - 1} x - {\left (5^{\frac {1}{4}} \sqrt {x^{2} + x - 1} {\left (2 \, \sqrt {5} - 5\right )} - 5^{\frac {1}{4}} {\left (\sqrt {5} {\left (2 \, x + 1\right )} - 5 \, x\right )}\right )} \sqrt {4 \, \sqrt {5} + 10} + 5 \, x + 5 \, \sqrt {5}} {\left ({\left (5^{\frac {3}{4}} {\left (2 \, \sqrt {5} + 3\right )} + 2 \cdot 5^{\frac {1}{4}} {\left (4 \, \sqrt {5} - 5\right )}\right )} \sqrt {4 \, \sqrt {5} + 10} - 2 \, \sqrt {5} {\left (3 \, \sqrt {5} + 10\right )} + 20 \, \sqrt {5} - 80\right )} + \frac {2}{55} \, \sqrt {x^{2} + x - 1} {\left (\sqrt {5} {\left (2 \, \sqrt {5} + 3\right )} + 8 \, \sqrt {5} - 10\right )} - \frac {1}{55} \, \sqrt {5} {\left (16 \, x + 3\right )} + \frac {1}{275} \, {\left (5^{\frac {3}{4}} {\left (\sqrt {5} {\left (3 \, x + 4\right )} + 10 \, x - 5\right )} - \sqrt {x^{2} + x - 1} {\left (5^{\frac {3}{4}} {\left (3 \, \sqrt {5} + 10\right )} - 10 \cdot 5^{\frac {1}{4}} {\left (\sqrt {5} - 4\right )}\right )} - 10 \cdot 5^{\frac {1}{4}} {\left (\sqrt {5} {\left (x - 6\right )} - 4 \, x + 13\right )}\right )} \sqrt {4 \, \sqrt {5} + 10} + \frac {4}{11} \, x - \frac {2}{11}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {2 x + 1}{\left (x^{2} + 1\right ) \sqrt {x^{2} + x - 1}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 457 vs.
\(2 (86) = 172\).
time = 5.18, size = 457, normalized size = 3.91 \begin {gather*} \frac {1}{4} \, \sqrt {2 \, \sqrt {5} - 4} \log \left (16 \, {\left (15 \, \sqrt {5} {\left (x - \sqrt {x^{2} + x - 1}\right )} + 33 \, x + 5 \, \sqrt {5} - 33 \, \sqrt {x^{2} + x - 1} + 2 \, \sqrt {5 \, \sqrt {5} + 11} + 11\right )}^{2} + 16 \, {\left (5 \, \sqrt {5} {\left (x - \sqrt {x^{2} + x - 1}\right )} + 11 \, x - 5 \, \sqrt {5} \sqrt {5 \, \sqrt {5} + 11} - 15 \, \sqrt {5} - 11 \, \sqrt {x^{2} + x - 1} - 11 \, \sqrt {5 \, \sqrt {5} + 11} - 33\right )}^{2}\right ) - \frac {1}{4} \, \sqrt {2 \, \sqrt {5} - 4} \log \left (16 \, {\left (15 \, \sqrt {5} {\left (x - \sqrt {x^{2} + x - 1}\right )} + 33 \, x + 5 \, \sqrt {5} - 33 \, \sqrt {x^{2} + x - 1} - 2 \, \sqrt {5 \, \sqrt {5} + 11} + 11\right )}^{2} + 16 \, {\left (5 \, \sqrt {5} {\left (x - \sqrt {x^{2} + x - 1}\right )} + 11 \, x + 5 \, \sqrt {5} \sqrt {5 \, \sqrt {5} + 11} - 15 \, \sqrt {5} - 11 \, \sqrt {x^{2} + x - 1} + 11 \, \sqrt {5 \, \sqrt {5} + 11} - 33\right )}^{2}\right ) + \frac {\sqrt {2 \, \sqrt {5} - 4} {\left (\arctan \left (3\right ) + \arctan \left (\frac {1}{10} \, {\left (x - \sqrt {x^{2} + x - 1}\right )} {\left (\sqrt {5} \sqrt {5 \, \sqrt {5} + 11} + 4 \, \sqrt {5} - 5 \, \sqrt {5 \, \sqrt {5} + 11}\right )} - \frac {7}{10} \, \sqrt {5} \sqrt {5 \, \sqrt {5} + 11} + \frac {1}{5} \, \sqrt {5} + \frac {3}{2} \, \sqrt {5 \, \sqrt {5} + 11}\right )\right )}}{2 \, {\left (\sqrt {5} - 2\right )}} - \frac {\sqrt {2 \, \sqrt {5} - 4} {\left (\arctan \left (3\right ) + \arctan \left (-\frac {1}{10} \, {\left (x - \sqrt {x^{2} + x - 1}\right )} {\left (\sqrt {5} \sqrt {5 \, \sqrt {5} + 11} - 4 \, \sqrt {5} - 5 \, \sqrt {5 \, \sqrt {5} + 11}\right )} + \frac {7}{10} \, \sqrt {5} \sqrt {5 \, \sqrt {5} + 11} + \frac {1}{5} \, \sqrt {5} - \frac {3}{2} \, \sqrt {5 \, \sqrt {5} + 11}\right )\right )}}{2 \, {\left (\sqrt {5} - 2\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {2\,x+1}{\left (x^2+1\right )\,\sqrt {x^2+x-1}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________